<template>
  <div class="group">
    <div  class="groupname" v-for="(item,index) in groups"  :class="{tab_act:index == num}"  @click="tab(index,item.id)" >
      {{item.name}}
    </div>
  </div>
</template>

<script>
    export default {
        name: "group",
      props: {
        groups: Array,
        num:Number
      },
      methods:{
        tab(index,id) {
          console.log(id)
          this.$emit('tabChange', index)

          // this.$router.push({path:id})
          // this.num = index;
        }
      }
    }
</script>

<style lang="less" >
  .group{
    width: 25%;
    height: 100%;
    overflow: auto;
    float: left;
    background-color: #ffffff;
  }
  .groupname{
    width: 100%;
    height: 50px;
    line-height: 50px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;

  }
  .tab_act{
    border-left: 3px solid @_green;
    color:@_green
  }
</style>
